import store from '@/store' 
import Vue from 'vue'
const has = Vue.directive('has', {

inserted:function (el, binding) {
   let perm=binding.value.perm;
	 let rolesPerm=store.getters.roles;
   if(perm&&rolesPerm){
   	if(rolesPerm.indexOf(perm)==-1){
   		  el.remove();
   	} 
   }
  },
});


export function ckPermission (perm) {
	if(perm){
		console.log(store.getters.roles)
		return store.getters.roles.indexOf(perm)>=0;
	}
	return false;
}



